/** 
 * @fileoverview 
 * layout.spiral package
 * 
 * 
 * @author Kelemen Viktor kelemen.viktor@gmail.com
 * @version 0.1
 * 
 */

YAHOO.namespace('layout.spiral');

	/**
	 * Makes a spiral from the elements
	 * 
	 * @param {Array} elements
	 * @param {Object} config
	 */
	YAHOO.layout.spiral.makeSpiral = function(elements, config) {	

		var alpha = config.alpha;
		var r = config.r;

		var cx = config.cx != null ? config.cx : 0;
		var cy = config.cy != null ? config.cy : 0;

		dojo.forEach(elements, function(e,i)	{
										
			e.setTransform({ dx: sin(alpha*i)*(r-i)+cx, dy: cos(alpha*i)*(r-i)+cy });			
		});
		
    }     